package com.example.footclassfiydome.service;

import ai.djl.Model;
import ai.djl.basicmodelzoo.cv.classification.ResNetV1;
import ai.djl.ndarray.types.Shape;
import ai.djl.nn.SequentialBlock;
import org.opencv.ml.Ml;

/**
 * Created by lilijava
 * on 2024/12/25
 * <p>
 * on  foot-classfiy-dome
 * @author DELL
 */
public class Models {

    private static final String modelName = "footweaver";
    public static Model getModel(){

        //1、创建一个模型
        Model model = Model.newInstance(modelName);

        //2、定义神经网络； MLP

        //残差网络； 应用层：套现成，练模型，调参；   底层：开发算法
        SequentialBlock resNet = ResNetV1.builder()
                // 100*100 像素， 每个像素表示成3个数字；  万物表示为向量/张量
                .setImageShape(new Shape(3, 100, 100))
                .setNumLayers(50) //50层
                .setOutSize(4)
                .build();//分类数量

        //以后训练它
        model.setBlock(resNet);
        return model;
    }
}

